Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st_join renames geom column to geometry if x is st_sf with only a st_sfc col #2327

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

faridcher
Copy link
Contributor

@faridcher faridcher commented Feb 5, 2024

z <- st_sf(pid=5, geom=st_sfc(st_polygon(list(matrix(c(0,0,4,0,4,4,0,4,0,0),ncol=2, byrow=T)))))
x <- st_sf(id=1:2, geom=st_sfc(st_point(1:2), st_point(2:3)), geom2=st_sfc(st_point(1:2), st_point(2:3)))
# OK
st_join(x,z)
Simple feature collection with 2 features and 2 fields
Active geometry column: geom
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 1 ymin: 2 xmax: 2 ymax: 3
CRS:           NA
  id pid        geom       geom2
1  1   5 POINT (1 2) POINT (1 2)
2  2   5 POINT (2 3) POINT (2 3)

# No OK
st_join(x[,'geom'], z)
Simple feature collection with 2 features and 1 field
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 1 ymin: 2 xmax: 2 ymax: 3
CRS:           NA
  pid    geometry
1   5 POINT (1 2)
2   5 POINT (2 3)

…t_sfc col.

z <- st_sf(pid=5, geom=st_sfc(st_polygon(list(matrix(c(0,0,4,0,4,4,0,4,0,0),ncol=2, byrow=T)))))
x <- st_sf(id=1:2, geom=st_sfc(st_point(1:2), st_point(2:3)))
st_join(x[,'geom'], z)
@edzer edzer merged commit 83bc795 into r-spatial:main Feb 9, 2024
7 checks passed
@faridcher faridcher deleted the patch-2 branch February 9, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants